package com.corpgovernment.common.utils;

import com.ctrip.corp.obt.generic.core.ttl.Ttl;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ExecutorUtil {

    private static BlockingQueue<Runnable> bqueue = new ArrayBlockingQueue<Runnable>(100);

    @Deprecated
    public static ThreadPoolExecutor logExecutor = new ThreadPoolExecutor(2 * Runtime.getRuntime().availableProcessors(), 50, 50, TimeUnit.MILLISECONDS, bqueue,
            new NameThreadFactory("记录操作日志"));


    public static Executor ttlLogExecutor = Ttl.wrap(new ThreadPoolExecutor(2 * Runtime.getRuntime().availableProcessors(), 50, 50, TimeUnit.MILLISECONDS, bqueue,
            new NameThreadFactory("记录操作日志")));
}